<?php
/**
 * Enter description here ...
 * @author NgoAnhTu
 * @date 2013-11-02
 */
abstract class AttachController extends CPanelController {
	
	const VIEW_PATH = 'cpanel/view/attach/';
	const PICS_ITEMS = 5;
	
	protected $type = '';
	protected $name = '';
	
	/**
	 * @var AttachBusiness
	 */
	private $attachBusiness;
	
	/**
	 * Constructor
	 */
	public function AttachController ($type = '', $name = '') {
		parent::CPanelController();
		$this->attachBusiness = AttachBusiness::getInstance();
		$this->type = $type;
		$this->name = $name;
	}
	
	/**
	 * Action: View all Attachment
	 * @action(attgrid)
	 */
	public function attgrid($pattern = '', $page = 1) {
		$MSG_CONFIRM = '';
		$MSG_CREATE_TITLE = '';
		$TYPE = $this->type;
		$result = $this->attachBusiness->search($this->type, $pattern, $page);
		require_once self::VIEW_PATH . 'grid.html';
	}
}
?>
